<%@page import="java.util.Date"%>
<%@page import="org.ocpsoft.pretty.time.PrettyTime"%>
<%@page import="edu.hcmus.sow.utils.SecurityUtil"%>
<%@ page language="java" isELIgnored="false" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:directive.include file="/WEB-INF/sitemesh-decorators/include.jsp" />

<div class="grayBackground boldBlack" style="display: none">
   There are currently <span>0</span> comments
</div>
<!-- comments -->
<c:forEach items="${comments}" var="cmt">
<div class="commentContainer">
   <span>
      <a class="profileThumb" href="#">
      <span class="thumbmask">
         <span class="topleft"></span>
         <span class="topright"></span>
         <span class="bottomleft"></span>
         <span class="bottomright"></span>
         <img id="profileImg333" src="${pageContext.request.contextPath}/images/default_profile.png" />
      </span>
      </a>
   </span>
   <div class="commentContainer_text">
      <div class="commentContainer_arrow"></div>
      <span class="author">${cmt.user.username}</span>
      <span></span>
      <c:set var="commentCreatedDate" value="${cmt.createdDate.getTime()}"></c:set>
      <span class="date"><%=new PrettyTime().format((Date) pageContext.getAttribute("commentCreatedDate"))%></span>
      <span class="tab">
         <a class="deleteComment" id="deleteComment${cmt.id}" href="#" onclick="" cid="${cmt.id}"><img src="${pageContext.request.contextPath}/images/admin-remove.png" alt="delete" /></a>
         <a id="editComment${cmt.id}" href="#" onclick="">Edit</a>
         &nbsp;|&nbsp;
         <a href="#deleteComment${cmt.id}" onclick="reply(this);" class="reply">Reply</a>
      </span>
      <div class="commentContainer_text_comment">
         <span class="version">[Commented against version ${file.revision}]</span><br>
         ${cmt.content}
      </div>
      <div class="corner corner_nw"></div>
      <div class="corner corner_ne"></div>
      <div class="corner corner_se"></div>
      <div class="corner corner_sw"></div>
   </div>
</div>
</c:forEach>
<!-- end comments -->